var webpack = require('webpack');

module.exports = {
  //插件项
  plugins: [
    // new webpack.optimize.UglifyJsPlugin({
    //   compress: {
    //     warnings: false
    //   }
    // })
  ],
  //页面入口文件配置
  entry: {
    chat: './web/webim/index.js'
  },
  //入口文件输出配置
  output: {
    path: 'public/js',
    filename: '[name].bundle.js'
  },
  module: {
    //加载器配置
    loaders: [
      {test: /\.css$/, loader: 'style-loader!css-loader'},
      {test: /\.js$/, loader: 'jsx-loader?harmony'},
      {test: /\.scss$/, loader: 'style!css!sass?sourceMap'},
      {test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'},
      {test: /\.html$/, loader: 'html-loader'}
    ]
  },
  //其它解决方案配置
  resolve: {
    extensions: ['', '.js', '.json', '.scss']
  },
  externals: {
    jquery: 'window.$'
  }
};
